package redis

import (
	"github.com/go-redis/redis"
	"time"
)

// 存redis(string类型)
func SetRedis(key, value string, expiration time.Duration) error {
	err := RedisClient(func(rdb *redis.Client) error {
		rdb.Set(key, value, expiration)

		return nil
	})
	if err != nil {
		return err
	}
	return nil
}

//key redis 的键值
//value 存储的数据
//expiration 存储时间
